Optimal. Leaf size=100 \[ \frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} f}-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {4088, 12, 3916,
2738, 214} \begin {gather*} \frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{f (a-b)^{3/2} (a+b)^{3/2}}-\frac {(b c-a d) \tan (e+f x)}{f \left (a^2-b^2\right ) (a+b \sec (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 3916
Rule 4088
Rubi steps
\begin {align*} \int \frac {\sec (e+f x) (c+d \sec (e+f x))}{(a+b \sec (e+f x))^2} \, dx &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {\int \frac {(-a c+b d) \sec (e+f x)}{a+b \sec (e+f x)} \, dx}{-a^2+b^2}\\ &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {(a c-b d) \int \frac {\sec (e+f x)}{a+b \sec (e+f x)} \, dx}{a^2-b^2}\\ &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {(a c-b d) \int \frac {1}{1+\frac {a \cos (e+f x)}{b}} \, dx}{b \left (a^2-b^2\right )}\\ &=-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}+\frac {(2 (a c-b d)) \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{b \left (a^2-b^2\right ) f}\\ &=\frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} f}-\frac {(b c-a d) \tan (e+f x)}{\left (a^2-b^2\right ) f (a+b \sec (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.40, size = 97, normalized size = 0.97 \begin {gather*} \frac {-\frac {2 (a c-b d) \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac {(-b c+a d) \sin (e+f x)}{(a-b) (a+b) (b+a \cos (e+f x))}}{f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 132, normalized size = 1.32
method | result | size |
derivativedivides | \(\frac {-\frac {2 \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-a -b \right )}+\frac {2 \left (a c -d b \right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a +b \right ) \left (a -b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{f}\) | \(132\) |
default | \(\frac {-\frac {2 \left (a d -b c \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-a -b \right )}+\frac {2 \left (a c -d b \right ) \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a +b \right ) \left (a -b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{f}\) | \(132\) |
risch | \(\frac {2 i \left (a d -b c \right ) \left (b \,{\mathrm e}^{i \left (f x +e \right )}+a \right )}{a \left (a^{2}-b^{2}\right ) f \left (a \,{\mathrm e}^{2 i \left (f x +e \right )}+2 b \,{\mathrm e}^{i \left (f x +e \right )}+a \right )}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) a c}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) d b}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) a c}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {-i a^{2}+i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right ) d b}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) f}\) | \(396\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.77, size = 408, normalized size = 4.08 \begin {gather*} \left [\frac {{\left (a b c - b^{2} d + {\left (a^{2} c - a b d\right )} \cos \left (f x + e\right )\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (f x + e\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (f x + e\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (f x + e\right ) + a\right )} \sin \left (f x + e\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (f x + e\right )^{2} + 2 \, a b \cos \left (f x + e\right ) + b^{2}}\right ) - 2 \, {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \sin \left (f x + e\right )}{2 \, {\left ({\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f \cos \left (f x + e\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f\right )}}, \frac {{\left (a b c - b^{2} d + {\left (a^{2} c - a b d\right )} \cos \left (f x + e\right )\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (f x + e\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (f x + e\right )}\right ) - {\left ({\left (a^{2} b - b^{3}\right )} c - {\left (a^{3} - a b^{2}\right )} d\right )} \sin \left (f x + e\right )}{{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} f \cos \left (f x + e\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} f}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (c + d \sec {\left (e + f x \right )}\right ) \sec {\left (e + f x \right )}}{\left (a + b \sec {\left (e + f x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.50, size = 173, normalized size = 1.73 \begin {gather*} -\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (2 \, a - 2 \, b\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} {\left (a c - b d\right )}}{{\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} - \frac {b c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - b \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - a - b\right )} {\left (a^{2} - b^{2}\right )}}\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.20, size = 106, normalized size = 1.06 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {a-b}}{\sqrt {a+b}}\right )\,\left (a\,c-b\,d\right )}{f\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}}+\frac {2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\left (a\,d-b\,c\right )}{f\,\left (a+b\right )\,\left (a-b\right )\,\left (\left (b-a\right )\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2+a+b\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________